package com.utrailer.ult.common;

import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;

/**
 * TODO
 *
 * @author Chen Song
 * @since
 */
public class Generator extends BaseGenerator {

    /**
     * 数据源配置
     */
    private static final DataSourceConfig DATA_SOURCE_CONFIG = new DataSourceConfig
            .Builder("jdbc:mysql://94.191.120.17:3306/wlt?serverTimezone=Asia/Shanghai", "root", "Chensong@123")
            .schema("wlt")
            .build();


    public static void main(String[] args) {
        AutoGenerator generator = new AutoGenerator(DATA_SOURCE_CONFIG);

        PackageConfig packageConfig = packageConfig()
                .parent("com.utailer.wlt.order")
                .build();
        ;
        StrategyConfig strategyConfig = strategyConfig()
                .addInclude("wlt_order")
                .addTablePrefix("wlt")
                .build();
        ;

        generator.global(globalConfig().build());
        generator.strategy(strategyConfig);
        generator.packageInfo(packageConfig);
        generator.execute();
    }
}
